Fixing signed/unsigned mismatch