Handle grouped data in nth.

The problem here is that get_field could cope with grouped data and nth
couldn't; so there was no coherent result for that method.  We resolve
the situation by changing nth to cope with grouped data.