Properly allocate and dynamically resize.