Various improvements from code reviews

Improvements from the code review at https://github.com/jenkinsci/jenkins/pull/769