Fix syntax error

This fixes e65d9c4f. Setting a variable can't end with :
This also fixes the issue with referenced before assignment