Исправления от asm0dey

Fixed various errors in changeFunc. Ids could not be found before this,
so it was impossible to add/change credentials.