Core data fixes