Add more adoptPtr
Created attachment 68922 [details] Work in progress
Almost everything in the patch on this bug is fixed. No need to keep this open.