Fix error in pubsub methods.