minor fixes
Major logging improvements