Fixes #277

Fix for #227