Minor fixes to functions.js.php