Fixed printing bug and file reading in bug