Patch attached. Only found one case where SV*MAGICAL_off() was called after mg_free. (in Perl_sv_setsv_flags in sv.c) Tested with blead. (All tests pass) Kind regards, Bram