Cleanup code.
Fix remote address problem.