Fix issues with vector overrun, dealloc calls.