Fixed compatibility issues for OpenGL 2.1