Fix python syntax errors