Use type switch in merge functions
Remove unused named return arg
fixed type
Merge pull request #263 from davecheney/130-refactor-merge-functions

Use type switch in merge functions

Followup PR from #262. 

* Use a type switch rather than a type assertion when checking for unexpected values in merge functions
* Drive by code cleanups.