Fix a bug at line 36 and remove a dead var