Cleanup: removing unused variables.
Cleanup: added missing header files.