Back-ported PROTOCOL.ANY changes from Tom Hite