Fix publish functionality.