Fix variable scope error.