Safely fix most compilation warnings
Fix remaining compilation warnings (more dangerous)

This fix changes a size to use size_t instead of off_t, and then fixes
the remaining warnings. While I think this makes sense, this requires
further testing.