Fix bug for shorter files.