Corrected a typo in if statements