in the end , the movie retreated from its own radical premise-the good townspeople learned the error of their ways-but only after the swarthy migrant farmer had been killed by a group of outsiders in black hats .