64 bit warnings

Use size_t where appropriate to prevent conversion warnings.