Remove unused variables, small cleanup

Removed variables that weren't being used, one default value that was assigned but never used, and one variable that wasn't declared before use.