Migration a couple of bits to unsigned int.
Note to Zebediah (mainly on second commit of this serie): - there is also a load of 'uint32_t flags' parameters that I didn't change (mainly not to change too many things) Is this something to consider? - I didn't touch the local variables either. Maybe it's something to consider also.