Fix Perl side not destroying objects in time