Fixed linux specific issues. Read line is more efficient