[[ Bug 12846 ]] Copy bugfix 12463 to refactored code