Fixes for orcm_finalize and orcm db framework seg fault