Fixes an issue with serialization of `Decimal`s

Or any instance of `Number` or `basestring`