Fix destructor inheritance bug