Rewritten namespace_finddir() to work