Fix core data issues