fix typo, add a mutex in pms_cache(I think there's a rare race cond there).