Additional test coverage for the label helper

Ticket #8641 was accepted (and committed in r7541) without test coverage for cases with autoindexing and nested objects. I added a patch for the missing coverage in Anyone care to have a look and give thumbs up, it's just a quick and short addition to the test suite.