fix bugs with rangefix