Bug fix.
Switch logic in if statement.