Merge changes I46690d1c,I84c11aa5

* changes:
  init: do not log directly from read_file() and write_file()
  init: Check DecodeUid() result and use error string