Don't update the current file twice. Debug statements on updates. It
looks like the index isn't getting updated on insert, so a query isn't
returning an expected match.