Fix purge. Write roles to file.