Fix deprecation warnings

FIx some deprecation warnings with the latest rustc