Add interactive plot and a few bug fixes