[needs review] Fix compilation on MacOS X 10.9

* Various type mismatches between signed/unsigned.
* Do not include tr1 on LLVM