Fixed bugs. subquery works well.