sdl fixes; fixes #1251