fix some opengl errors