Fix bug in if statement.