add and fix some unittests: coverage 46%