Fixing a signed vs. unsigned issue