Removed extra comma from package.json
Fixed function name in generated script to escape characters when needed