The number of votes on this package is truly amazing. Most packages lately are lucky to get the requisite 5. Shows this is needed. Way to find something people want. :-)
My condition is:
Move the if (defined('SHELL')) stuff out of the class file. All class files should have only the class file (and possibly register function calls like in the case of QF elements). Move this code to a 'phpshell' script which is installed as an executable, such as the pear install does with 'pear' (or as phpDocumentor does).