Change int -> unsigned and some typedefs