Bug fix for output printing