minor bugfix and improve

fixes
* master thread unexpected shutdown (with run mode)
* makes php-sample runable, out of the box