Add required imports for Python 3 port
Remove close() on __del__, explicitly close log files