Fixes + unittests