Fixed issue, where infile does not exist, causing a return of None