Code cosmetics: Reduces the amounts of warning.

Removes the warnings by adding missing headers and removed unused variables.