Fixed sorting error.

Introduced in 82e68bda91fd7df4fc65455ab3cfb1866f50bcb9.