Fixed some bugs in the print command