Fix a couple of warnings and remove an unused variable.