Merge "Consistent error checking for sp<IMemory> and pointer()"