Fix bug with encoding of empty arrays in binary format