Fix issues with logging