Introduce read_file() helper, improve error reporting