Cook 2869 - better test for empty directory