Fix a bug in PERFECT-P where it literally didn't work at all.