Fixed OSX problems, some OpenGL adjustment.