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

why not just use `len(rows_dict)` (same applies above)