Fix and simplify readFile()