Fixes #2346: ActiveQuery used in building sub-query should not need to set FROM clause explicitly.