Fixed text encoding bug with invalid UTF-8 characters
Logging info to log file