Merge useful changes from xapian-core