Added history decoding.