Assigning a principal
Some fixes