Fixed issue with key handling when using XOR encoder.