Fix config test and improve the cli error occured