Fixed the "No OpenGL context found in the current thread" exception.