fix most testsuite errors, improve proxy error handling