Remove managed boxes references from memory boxes and pointer types