Fixed the line reading in order to be able to be run on Ubuntu