Minor improvements
Fixed bug