Bugfix for issue #49