Stop leaking documents when importing.