Fixed other off-by-one error in cache