Fixed issue with storing pointers to objects in a vector