fixing minor bugs in prims