UHM-1667: Null pointer exception when merging patients