Bugfixes, improvements for publishing