Handle 0-length files correctly