Test VertexPartition and fix bugs