Fix role factory and test for future bad factories