Recovery tests and unittests are now working
Fixed memory leaks, valgrind errors