Fix distinct method for nested field (#58)

Sorry for the multiple redundant commits - this is the first time I'm doing this. Next time will be better :)