Fix return type of addMessage()