Fix potential for nastiness in the dashboard

References #311. Needs to be backported to 0.9.x.

cc: @jwheare