Fix empty cells logic