Fixed printing file to terminal