Fix bugs in PMS