Correction of subqueries

The subqueries functions requirements where not clearly specified.
Now solved.