Fix sorting embedded objects and single fields.

 Also fix a *count* issue in embedded objects.