Fixed warnings comparing signed and unsigned numbers