Fix copying of pointers in structs

The previous method inserted a pointer to a zero struct, not the actual struct in question.