Change mergeObject to have option to keep references