Fix bugs in GoToSleep