64-bit fixes

`int` values are not the same thing as `size_t` nor `ptrdiff_t`. Convert incorrect uses of `int` to more appropriate types.

Fixes warnings for 64-bit compilations.
Merge pull request #56 from seanmiddleditch/master

64-bit fixes