Fixed a bug where the first publish did not work. Previous fix also broke publishing. [fixes #56621058]