Applying Thomas' patch from LANG-917 - fixing Arne Burmeister's reported exception when combining custom and choice formats