Fix and optimize dirtree function