=act, rem, clu #3521: make serialize-messages work with core modules (backport)

(cherry picked from commit b566e93)