Corrections and cleaning

Removed unnecessary code and errors