Fixed a number of lint warnings, particularly around unused variables.