Ported bug fix for issue 27863 to J! 3.x