Correct a bug in roles assignment.