Fix build on 32 bit processors.

I filed #2264; I think this is a big-ish problem, and we should fix it for real by putting int64 everywhere. I started this and it got big quickly so put it on hold.

For a temporary solution-- I really think we should just not let systems with 32 bit int run at the moment. Covering it up like this is bad news and will come back to bite us.