Fixing #50, adding a test for it as well