Updated some if clauses