Fixed bug when serializing double values