PAM fixes for C -> C++ conversion.