resolved several issues in _plot.js