Fixed deprecation warnings for scopes