Fixed a CPU hog bug