Debug print to custom log
Syntax error fix
Compile error fix
Correct names of variables used in template