logging improvements and small fixes