Fixes and slightly adjusted logging