fix sim.NUM_PARTS, other small changes