Change fgetln (osx specific) in favour of getline (both osx and linux)