many fixes to xrm_mapfile