Update the code to work with more recent version of Rust