Small fixes in DB indexing.