Some improvements to file size functions