Fix unit tests, compiler warnings and add specs2