OpenGL reinitialization bug fix