Moved call to gl_NEXT_HEADER outside the conditional.