Fix if conditions