Fixed infinite loop problem on slower machines.
Merge pull request #1 from DisCODe/master

Fixed infinite loop problem on slower machines.