Issue #25: Use isfinite to check for non-finite decimal values when encoding.