Bug fix for empty cell logic.