Changed variable "logfile" to "logfile_fp".