Add unit test for preserveCollectionElement, add fix for primary collection helper