Some fixes to publish method