Additional fix to IndexDatabase to ensure that it's always the StateManager for it's DocumentScanner