handle merge cells better.

The previous code would fail if a merged_cell was represented as an array, but works if is represented as a hash. This code attempts to handle the array case. It won't cause a regression because it only changes the behavior in a scenario that currently fails.