Added utests
Fixed some unit tests