Fixed a bug that used the wrong value for 'length' when resizing arrays in dynarray.c