(bug 4062) Fix protocol version related code