Fix syntax errors, better debugging