Applied a fix as submitted by William Kyngesburye