Fix JS replacer fn