Fixed syntax errors and variable error