Fixed bug in if statements.