Fixed grid to handle null entities