Fixed logfile truncation (issue #6)