Removed unused variables and fixed a warning.