Fixing some problems with sub-document example.