Added support for embedded documents.