fix table alias preservation with nested clauses