Stopped CPU hogging, and fixed threads and other stuff.