Fixing as_json method for ScopeProxy