Updated type checking for AbstractDocument::create().