Fix index variable signedness