Some allocation-reducing micro-opts.

Eliminate a bunch of Int boxings on some hot paths.