Fix for combined textures
Code cleanup