Fixed bug in printing