Fix inf swapping for json
Merge