Merged from tim, changes to setRole
merged from dswd