fix some range calculation bugs with error bars, gaps with error bars