Fixing compatibility issues and fixing problem with setting texture unit to GLSL shaders.