use extend rather than merge

merge is for array-like objects and adds a length property which is
undefined in this case.