Fix spinach errors.
Add some tests for network graph