remove irrelevant trailing comma (issue with Google Closure compiler)
Fixed some function signatures for Google Closure
Added some missing semicolons
Get rid of unused variable
Missing semicolon