Commit a bunch of portability fixes (64- vs. 32-bit types).