Fix loop on rblock idref/id resolution during xml parsing.
Fix Tail element parsing, handle it as optional.