Fixed js bugs

Fixed 2x unnecessary `,` (should only be used with var declaration)
Fixed taggedParent defined in wrong scope