Fixed a bug whereby the text content would be stripped from the sort method.