Two small code fixes

One of them is needed for newer versions of TYPO3 (especially for the current LTS version 6.2). We did not test it with old TYPO3 LTS 4.5, but I expect that it will work there, too.
Another bug was detected while we validated the generated HTML code.