Fix some bug when printing log