Bugfix for issue #23