Sort category list, file & sql
- Fixed lost-connection and no-connection-available-at-start behavior.