Correct syntax errors. Change logging to DEBUG.