Fix as_endpoint