Fix for inlineCount issue with nested orderBy