Improve logging.
Fix tests.
0.4.1