Fix fail on empty history