#538 more dtor fixes and some style fixes along the way