Add parsing of inner text and fix many bugs.