Several fixes

fixes https://issues.jenkins-ci.org/browse/JENKINS-23483 and https://issues.jenkins-ci.org/browse/JENKINS-18110
Could you explain why such high jenkins version is needed?
Many people have older LTS versions and are not ready/willing to update.