More fixes to dupe handling

Change-Id: I682c200e6cb46ee6057cf74f5a6023558e4fb7ea
Merge "More fixes to dupe handling" into develop