Hotfix/issue #194 rebased

Fixes #194 - rebased version of #241