_CST repair: Handle null package entries.

Sort package only after null/bad elements have been removed.
Lv Zheng.