fixed bug in rd tool (ignore directories), some logging