Bugfix for issue #47