Fixing training exit. Code cleanup and removing unnecessary print messages.