Fixed some if statements