fix errors in RangeMap::streamout() and RangeMap::toRange()