Several changes
Fixed bug