Sort task list and fix reg error