Improve logging
Fix test regression