Added CoreData framework and fixed errors