Fix rank check for PMs