Merge "Simplify sleep() and fix overflow bug"