Fix reading input files