Fix "and" expression in if statement