I think this is an issue with the call to overlay_density_plot() within the ei_rxc() function. The error doesn't hit when you set diagnostic=T, but diagnostic=T only produces diagnostic plots not density plots. The function executes otherwise, if you don't want look at density plots.
