Fix assertions referring to global variables.