xajax: some fixes ported from xajax git