Restores debug logging in index task.
Adds tests.