Fix bugs to do with publication