GFX bugfixes and optimizations