Forgot to add: Interestingly without the additional blocks inserted by TXL in the if block the bug is not triggered (i.e. other tex operations work fine).