Corrected typos and bad variable namings.