Fix a couple of problems with gl