Tidy-ups and enhanced logging