Fix rename of empty files, and detection of empty.