Fixing logging variable issues