Fixed deprecation warnings #2