I just realized that I should check for NaN and infinity explicitly in the `ToJSON` instance for `Double` and `Float`...