Fix bugs; implement proxy support