Bugfixes. Now passing all W3C error tests as well.