Fixed logging.
Fixed tests.