Enable ARB_debug_output; fix some bugs uncovered with it