Various memory management updates in the CESDatabse