some fixes + Junit