Fixed some undefined variables