Added additional OpenGL error checking.