Sorting on sub-document.

Fixed sorting issue on sub-document.