Protect fix ported from Radford Neals pqR.
Protect fix ported from Radford Neals pqR.
Protect fix ported from Radford Neals pqR.