Fix HTML5 validation errors

Fixes #397.