Sort out a number of mismatched integer types in order to cut down the number of compiler warnings.