Normally, I don't ask for debugging help, but in writing a file picker, I've run into some bugs I can't seem to track down. The file picker is written to only allow the selection of directories, not of files, because I've written it for specific use in another project.
1) The first thing is with selections. If I select a folder and then close the folder TWO levels above it, I get an error. If I close the immediate parent folder, everything behaves as expected. This mystifies me, as everything is called recursively. The error does not appear if I haven't selected anything, which further confuses me, because the error appears somewhere that superficially has nothing to do with selection. 
2) If you open two directories, and close them in the same order they were opened, a weird overlap occurs. If you close them in the opposite order they were opened, this does not happen
I'm most immediately concerned about the first issue. If anyone more experienced could devote a little bit of time to helping me, I'd be hugely appreciative.