Fixed syntax errors in functions.js