Fix formatting, make sure it passes pylint better.
Fixed bug in log_error function.