fix some issues with pointer copies