Roles support & Various fixes

cc @dunglas