Add protocol name parameter.
Fix string encoding.