A little minor fix in Prim's algorithm