Fix JS error and unset files error