Fix some bug of output in terminal