some warning fixes and general sdl optimization