Setting msg fix, tests for publish