Renaming roles and fixing error cases