fixed most of the unittests