Corrected typos and if statement