Added fix for populating username as primary principal.