Remove bad variables from context where functions are run.