Working around some opengl problems