More unittests and small corrections