Fix OpenGL Errors

This fixes #461.