Fix erroneous potential size_t-to-int truncation.

In multiple places, the result of `std::string::find` was stored in an
`int`, which was then compared for inequality with `std::string::npos`.
This was erroneous because both `std::string::npos` and the result of
`std::string::find` are of type `size_t`, so, on a platform where
`sizeof(size_t) > sizeof(int)`, the result of `std::string::find` would
be truncated to the size of an `int`, and no mere `int` could ever equal
`std::string::npos`, so the comparison would always be true, even when
it should have been false.