Simplify IF usage when dealing with ! and !=.