Fix some deprecation warnings