Edit rules of encode_object for float