Fixed segmentation fault.

The size of messagem was too short. It' still quite strange.