Fixed some -Wextra warnings

They were mostly about int vs size_t comparisons.