utils; fix utils.merge

added test case
Merge pull request #1655 from j/merge

utils; fix utils.merge