diff --git a/modules/util/Util/Simple_CSV.pm b/modules/util/Util/Simple_CSV.pm
index f86f58525745c6da92bc4390f1a662d022c0fe5b..48c1dd295956c473b076858f3fc6bb565a4b6852 100644
--- a/modules/util/Util/Simple_CSV.pm
+++ b/modules/util/Util/Simple_CSV.pm
@@ -164,10 +164,12 @@ sub load_csv_file
   my $fi_open;
   (*FI, $fi_open)= $obj->open_csv_file ($fnm);
 
-  unless ($obj->{'no_headings'})
-  {
-    $obj->load_csv_file_headings (*FI);
+  $obj->load_csv_file_headings (*FI) unless ($obj->{'no_headings'});
 
+  if (@{$obj->{columns}}  # NOTE: columns might have been defined using $obj->define_columns(...)
+      && exists ($obj->{fidef})
+     )
+  {
     my ($fidef)= map { $obj->{$_} } qw(fidef);
     if (defined ($fidef))
     {
diff --git a/modules/util/csv.pl b/modules/util/csv.pl
index 52201f2d04340dea6ecfd429981bb7a58a4344e5..975a6984423f50ee7b3e7df176becb74e546c33d 100755
--- a/modules/util/csv.pl
+++ b/modules/util/csv.pl
@@ -112,6 +112,7 @@ while (defined (my $arg= shift (@ARGV)))
     elsif ($opt eq 'search' || $opt eq 'select')
     { # TODO: allow multiple searches!
       $search_string= $val || shift (@ARGV);
+      # print __LINE__, " search_string=[$search_string]\n";
     }
     elsif ($opt eq 'max')    { $max_items=     $val || shift (@ARGV); }
     elsif ($opt eq 'hdr')    { $view= 'header'; }
@@ -193,7 +194,7 @@ if (@set_columns)
   $csv->{'no_headings'}= 1;
 }
 
-# print "find_pattern=[$find_pattern] search_string=[$search_string]\n";
+# print __LINE__, " find_pattern=[$find_pattern] search_string=[$search_string]\n";
 
 if (defined ($find_pattern))
 {
@@ -244,14 +245,15 @@ print "procssing find_pattern=[$find_pattern]\n";
 
 if (defined ($search_string))
 {
-# print "procssing search_string=[$search_string]\n";
   my ($field_name, $field_value)= split ('=', $search_string, 2);
+# print __LINE__, " procssing search_string=[$search_string] field_name=[$field_name] field_value=[$field_value]\n";
 
   # the filter is dynamically generated since the field number is only
   # known after the column names are identified!
   sub fidef2
   {
     my $obj= shift;
+# print __LINE__, " in fidef2\n";
 
     my $cols= $obj->{'columns'};
     my $col= 0;