Fix return value of named scopes