Fix for #215 and some other related improvements

I don't like the constant name, I think it should be changed to `PROTOCOL_`, and all other occurences of "proto" should be changed also to "protocol". Agreed?