Fix serializer for non-decimal base.