Fixed deprecation warnings.