Better fix for older OpenGL versions