matrix/row resizing and associated tests