Deal with to_param CPK IDs in one place. Fixes #209.