Fix staging bug when using utf8 files