Fixed HTML5 compliance issues (fixes #318).