[FIXED JENKINS-8478] Based on xbeumala, thomasfox, mattakis and gauthierde pull requests