Refine `publish` block logic, fixes #58