Fix a bunch of issues resulting from recent OGL changes on OSX