Fix ambiguous column errors
getRemoteObjectsQuery now only queries relevant tables, in case joins to unrelated tables are added later.