Made destructors of inherited classes virtual