correct NightBeard's coding mistakes