Adjust integer types in "snprintf" calls, etc.

Adjusted integer types in a few calls to "snprintf" and modified the
return type of "get_upgrade_cost" from int32_t to uint16_t.