fix references to nested messages