Fix: use size_t instead of int in several places

This fixes compilation on my system (64-bit OS X)