Fixed some spelling in the documentation and removed some unused variables.