Sanitize file content when reading the graph from the file
Fixed a bug when there is only one edge in the graph.