Fixed singleton encounter problem. Fixed networkx problem