Fix incorrectly ordered arguments to the function and not properly merging lists.