bugfix:
- fix non-virtual destructor.
- fix compiler warnings.