Backport ProxyUtils clean up, close #507