Fix size conversion warnings.
Merge pull request #162 from square/alanf/fix-size-conversion-warnings

Fix size conversion warnings.

Reviewed by @firestone.