Source code clean up. Removed unused variables and resolving various warnings.