Some optimizations, fixing blitwizard.graphics.setMode crash