Fix variables not being reset after build