Smarter sleep; better message handling.