Fix compiler warnings due to non-virtual destructors.