Correct some typos and variable placements