Cleaned up potential cross-threading of references in IndexDatabase
Added logging protections to various else clauses.