Fix infinite loop
Merge pull request #28 from cmaion/master

Fix infinite loop