Fixed a few exceptions with rootnode/parentnodes, also a stupid bug with the cursor positioning after detecting a tag.