Fix for issue JENKINS-14955 (which also duplicate with issue
JENKINS-15965)