ensure that undirected graphs stay undirected after parse. Fixes #11