Fix issue with null env variable

Also had to update the git plugin to 2.4.2 to avoid an issue with 2.0