graph saving fixes and integration test