Fix refresh_file behaviors and remaining test.