Fix sleep

This should fix #441 in the proper way.