Better handling of messages

Change-Id: Ia3d07bae017f059505864808d351568fe411c9c3
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>