Adding some assertions to try and catch a CoreData bug earlier.