Merging ce18805.
potential fix for issue #335
fix test for issue #335

Updated sync function role based tests to pass a Map with role names as keys, rather than an array of role names