Fix null search error and tie domain from client to server for agreements.