readded fixes, which work, no we produce illegal XML, but no more segfault