further corrections to patient merge data scripts