Add support for ints/floats and arrays in the write function.