store the merged result, misc. cleanup