Avoid comparaison between signed and unsigned integers