port remaining functionality from orm merge() functionality.