bugfixes, extra graph-related convenience functions