Adding some unittests also patching