Added command to exit and a few other changes