Fixed non-virtual destructor of base classes.