More unsinged int -> int in some places where it could be difficult to find underflow bugs. And some warnings fix.