Resize function no longer causes a segmentation fault.