You call virtual_cwd_activate() here and in zend_activate(). I think one call must be enough.