Fixed possible 99% CPU bug