Fixed deprecation warning
Fixed failure in test