Remove unused variables and needless assignments.
Resolves #44