Fixed looping bugs, bug in SDL upscaling