Fixed some bug with advanced destructor.