Fix compressed length calculation with non-zero offsets