Correctly replay glUseProgram(0)
Check for validity of params before trying to serialise