fixes #55, added also a test for that bug
Merge pull request #58 from liuggio/fix_54_pull

fixes #55, added also a test for that bug