Fixes inverted range calculation
Changes range to be absolute.