Fix syntax and variable name in logging