fix a few 64-bit to 32-bit conversion warnings
Fix signed/unsigned warnings
Add a comparison operators for signed_int, correct the ones for unsigned_int