Fix truncation of 64-bit integers on 32-bit hosts.

Issue: PLDB-25
Submitted by: James Low