More bulletproof check of directory listing