Fix incorrect comparison between signed/unsigned