added and fixed unit tests