Fixing some undefined variables