Fix bug in publishing script