Liverpool were fortunate twice in the space of five minutes midway through the second half.