Fixed a bug when printing