Fixed typo that made a variable global.