FIXED JENKINS-19943 but credit should go to Nathan Kinder

To fix https://issues.jenkins-ci.org/browse/JENKINS-19943 which duplicates https://issues.jenkins-ci.org/browse/JENKINS-21182

Credit should go to Nathan Kinder, as I just used his patch and tested.