Correct some undefined variables and constants