Fixes issue #305 #306