Fixed a bug with changing the number of rows