Possible fix for JENKINS-16045

This is a possible fix for https://issues.jenkins-ci.org/browse/JENKINS-16045

(Recreate pull - small cleanup added)