Destroy dependent objects when destroying the parent. Fixes #26.