fix recoverfragments with n-ary nodes
add checks for binarized grammar