Clean up InvalidDocument/StringData handling.