Fix doctype handling in compiled templates