clean_merge_params function

Clean up parameters passed to mergeLayers