Improvements so SDL sleeps more nicely