Merging fix of TCH Demapper by @romankh. The fix works on all test data that I currently have.