Fixed Directory.count and Task.count
Added more tests