Improved subject handling

And also the log file encoding