Fixed a bug in the outline sorting.