Update code&test for Hook serialization