Fix deprecation warnings