Fixing crash (no longer keeping pointer to data in std::vector since any resize might invalidate it)