Fix bugs with conflicts detection logic.