CN - Fix a couple of errors in pid_rewrite().