Minor fix of if statements