Fix detection of success, add output to logs