Fix a bug in which intermediate results on toBigDecimal could overflow.