Fix condition mistakes