Fix issue 463

This is a final fix for issue 463
Merge pull request #506 from Drugoy/patch-1

Fix issue #463