Fix handling of empty files.