Bugfix for #192

Adding a simple fix and a test for it.