Fix deprecation warnings.