(warning) Fix declaration of global function
(warnings) Remove useless trailing semicolons
(refactoring) Fix indentation
(warnings) Remove unused variables
(warnings) Set destructor as virtual to avoid problems on subclasses