Bug fixing and some corrects