fixed a bunch of signed comparison warnings on linux