fixed js errors (trailing commas, builtin name usage)