logging improvements and misc