Fix duplicates being created on sync. Fix focus.