Added checks when parsing the protocol name and version (fixes #15)