Add better file handling to parser.