Fixing create_ subquery bug