Fix (find|all)_json when scope chain has joins with ambiguous names