Fixed bug on sleep if diagnostic mode with stop criteria