Fix bug when reloading file.