Remove unused variables. Fix warnings