Fix some warnings with recent version of Rust

This patch replaces `get()` calls with indexing for vectors and `str::from_utf8_lossy` with `String::from_ut8_lossy` to silence recent rustc warnings