Small bugfixes (while trying to pass the w3c suite)