Fix for missing virtual destructor for abstract class causing undefined behaviour.