minor fixes + use perl-safe (de)allocators