Fix variable name and useless variables