Fix JS file build issues