Fix some if statements