Fixed appendSorted to not mutilate its children