diff --git a/include/hpp/statistics/bin.hh b/include/hpp/statistics/bin.hh
index 2403a44dc888b1268e3eec5ebeb413b2bbe230bd..b9a01ac79324d5531543260e5955dbf2922c34ed 100644
--- a/include/hpp/statistics/bin.hh
+++ b/include/hpp/statistics/bin.hh
@@ -56,6 +56,7 @@ class HPP_STATISTICS_DLLAPI Bin {
  protected:
   /// Constructor
   Bin() : freq_(0) {}
+  virtual ~Bin() {}
 
  private:
   /// The number of occurence.
diff --git a/tests/test-successstatistics.cc b/tests/test-successstatistics.cc
index ea823f91015e6ae5ca600c7c6ce4ce9b4365c9bb..7d819ff303e48a1b86d872982a6fbfcd9c357d46 100644
--- a/tests/test-successstatistics.cc
+++ b/tests/test-successstatistics.cc
@@ -36,7 +36,7 @@ int main() {
   counter[1] = 0;
   counter[2] = 0;
   for (int i = 0; i < 100; i++) {
-    std::size_t nb = rand() % 3;
+    std::size_t nb = static_cast<std::size_t>(rand() % 3);
     counter[nb]++;
     switch (nb) {
       case 0: