Fix DOM Exception 12 Syntax errors

Fixed these by trial and error rather than any understanding.