Fixing some bugs in the print source code