Fix proxy rewriting

Change-Id: Id21531d2ee566932f2cdd49e2eb9a94d946663ec