Cleanup of unused variables, etc.