Use defined types, fix message constructor