Add a custom merge function.