Changed to check names rather than objects.