Added a new merge function which may respect existing entries when specified.

Updated example for 1.39.