Made destructor virtual to get rid of compiler warnings, issue #2 has disappeared as well...but even so without these changes. Weird.