Revert "Temporarily revert "Clean up published flag.""

This reverts commit ef2f0f5f2ca79d6f997c32fd60e3aac2f8998c7d.