fixes #148 + test case