More error fixes and improvements in code for datasets merging.