Fixes to adaptTo for valuemap merging