Fix the code to compile with latest Rust