Fixed possible infinite loop
Merge pull request #11 from vGubriienko/master

Fixed possible infinite loop