Fix F841 errors of unused local variables