Fixed a bug in the mediator publish method, and more tests about it implemented