Fix signed/unsigned comparisons
Make it build on llvm 3.5