Fix warnings and errors for latest Rust