Fix and corresponding test for issue #137

At least it fixes it for me :smirk: