collection: merge() changed to static mergeByPrimary() & fixes