Bug fixes on Graph class