Fix infinite loop due to size/unsigned mismatch.
Merge pull request #738 from sorlok/fix_size_t

Fix infinite loop due to size/unsigned mismatch.