Improved robustness and speed of sleeping logic.