Fix specs and fix bug in object sorter sorting.