Several fixes

We now properly convert to GLboolean, which is what fixes those glGetBooleanv functions that sometimes returned integers. Several other fixes.