fix nil scope
fix for default ordering by PK when column names are ambiguous due to being present in multiple tables in the query