Turn several nats into StgWord to avoid potential integer overflow (#7762)