Fix data recover related bugs