Fixed core data bug