Added more corrections to PAM code.