Fix some issues caused by the switch to ID as key

Changing the account name messed everything up, added some extra checks to prevent errors