Fixed xrange bug