Avoiding Phantom port in-use error while restarting, fixing maxNumberOfRequests logic