Fix rare conditions on file size