Improve directory skipping and address other review comments.