Fix prefetch subquery generation.