Fix some signed comparison errors on gcc