Changed to let the $doctypes in documents follow the types in types.inc