Fixed infinite loop problem on slower machines.