Various SDL fixes