be more careful about memory leaks
fix sig test in ancient perl
fix test compatibility with old debuggers and protect against environment