Fixed returning nulls, as that can cause errors incertain build types

See https://issues.jenkins-ci.org/browse/JENKINS-15094 (Thanks Oleg!)