Fixed null pointers on the add core to grid method