Fixed deprecation warnings