fixed bugs
Fixed tests