minor bug in self.as_undirected() corrected