Fixed minor bug
Some modifications