added test
fixed broken test
Merge pull request #1 from fojas/master

Added test. Fixed code.