backport of fix in PR 109
Merge pull request #110 from arnehormann/legacy-fix

backport of fix in PR 109