Improve port to client reference handling.