fixes #55, added also a test for that bug