Fix local/global variable clash in the scale module.