Bug #3783 (PHP 5.2 incompability)
Anonymous functions are incompatible with PHP 5.2
many some minor fixes (sorry, see diff)