Fix bug in index rename for publishing.