Fixes and logging