Replaced \r\n to \n for line break and other fixes