Reverted encode decode changes which were causing data to
become unlinked