Fixed the sorting of z-ordering.

[FIX] Fixed the incorrect z-ordering sort.