Negative numbers need special treatment in toJSON conversion.