Fixed logfile not being freed
Improved logfile class