Fixes issue #315