Miscellaneous bug fixes to map2Prof function