Fixes issue #49 on master