Fixed issues with merging scans with same UIDs as the existing ones.