Database crashes (ab-initio/heterogeneous ref)

@stavros The database engine encountered an inconsistency in a database file. Please see this related topic for some recommendations.