Fixed HTML5 compliance issues (fixes #322).