Added handling to make sure all rows have the same length.
Merge pull request #4629 from lwyszomi/143728-case

Added handling to make sure all rows have the same length.