Fix nil error for empty files