Improvements and fixes. Beginning to clean output (log files)