Fix bytes vs unicode error when missing DTD