Revert earlier fix for #811 it should be debug code. Additionally fixes
GL3 compile error.