Fix exception during auto-sorting

Wrapping element retrieval in jQuery selector so calling .children() will work.