fix some bugs in the PIC model.