Fixed some errors related to merging data.