Fix encoding / decoding of sequences by avoiding native types