Fixed a bug which produced an invalid range.