Various bug-fixes for W3C test conformance and stack traces with exceptions and segfaults