proresdec: Properly make sure an index doesn't run past the limit