Fix directory scan bug
Fix type error
Fix treeview selection bug