Different fixes after automatic checks

`strlen` returns `size_t`, so this should either do an explicit cast, or, better, change the type of `len` to `size_t` (it's likely to throw a warning otherwise, in case `sizeof(size_t) > sizeof(int)`)