Improve logging, fixes #6