Fixed issues with parsing PUBLISH messages