Replaced all int's with fixed-width int32_t so width is guaranteed.