Testcase for #18
Fixes #18, including test case