Fix protocol and version parsing