Declared a virtual destructor and more compile warnings