64-bit fixes.
Merge pull request #171 from ChrisGrant/master

64-bit fixes.