Fixed issues with CPU loop