Mantis 5917: Take Sorted into account