Add sleep timer
osx: Fix problems causing no text to be rendered sometimes