cas: WIP fixing a bug with Decode