[FIXED JENKINS-19488] Expand variable in a consistent way