Fix sql test errors