I noticed that two of the column names in 'dat' dataframe were wrong (perhaps a recent update?). middle is now xmiddle.
p + geom_segment(data=dat, aes(x=xmin, xend=xmax,
y=xmiddle, yend=xmiddle), colour="red", size=2)