Localise some local variables to avoid direct external manipulations.