Inprove logging
Fix compile issue/