Tested, fixed bugs, improvements

Removed unwanted space, improved cleaning process, removed bugs, some
output improvements.
Prevent errors