Adapted to the changes of the Message api.