Fix serialization of dependency graph.