Fix references to wrong variable. Fix debug code in the cheats.