Fix #834. The select_bar bug was due to the barPlot being implicitly mad...

...e

into a global variable.