Remove getGLError plus some misc small changes.

I also put some other changes that done in other pull here .