Logger improvements.

Fixed some problems with the logger.