Sleeping works

Fixes #707 and FS392. Cherry pick because 1e87f2f was accidentally pushed to master?