add tests and support for repeated nested messages