Fix getScopes returning object instead of array