I took care of making the 3 cases you mentioned working in the new version of the patch attached. It worked in my case for both shell and setshell without any problem. The code has also been reorganized so as to lighten the process in doCustom. It looks cleaner on this part.
The only remaining issues are the thread bug and the documentation. For the bug, I am currently looking into it. I should take a little bit of time, I don't really know yet from where it comes exactly... For the documentation, I'll try to write it a little bit more once the code issues are solved.
Regards
-- Michael Paquier NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center