Delete unused variable
Delete unused include
Remove a temp variable

Changed the logic that formerly used the temp variable into a branch,
to suppress a warning.