Cleanup and key conflict resolution.