Bugfix for issue #51