Fix memory leak and wild SIGTRAP.
Add test objects.