Fix jsonification of messages (conversion from enum to code number) - tests missing