Fixed bug where ranges weren't including last value when scanning using reverse index.