Allow both unix and windows eol in input files, fix minor issues