Fixing up check for empty directory