Fix errors in PAM codec.