Fix bug in array decoding