Fix recursive treewalk for multideep branches

-Dx
getPReference now returns first item of array, not an array - and refactored rest not to die over this fact

-Dx