Log debug messages to file.
Fix if condition.