Fixed varible name and removed possible uninitialized value (on non-git reference).