Fixed memory resizing.