Corrected some conditional statements.